package com.gyul.findmystock.ui.stock.chart;

import java.util.ArrayList;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;

import com.gyul.findmystock.analysis.MACD;
import com.gyul.findmystock.entity.QuoteEntity;

public class Chart {

	public static ArrayList<QuoteEntity> quoteList = null;
	public static MACD macd = null;
	
	public static final int MaxDrawStockSize = 150;
	public static final int MinDrawStockSize = 30;
	public static final int STOP = 0;
	public static final int LEFT_MOVE = 1;
	public static final int LEFT_FAST_MOVE = 2;
	public static final int RIGHT_MOVE = 3;
	public static final int RIGHT_FAST_MOVE = 4;
	public static final int ZoomChangeValue = 10;
	
	public static int chartBackgroundColor = Color.rgb(235, 235, 235);
	public static boolean initialized = false;
	
	public static int drawStockSize = 30;
	public static int quoteListSize = 0;
	public static int startIndex = 0;	
		
	public static float chartWidth = 0;
	
	public static float chartWidthGap = 0;
	public static float chartWidthGapBlank = 0;
	
	public static boolean showInfo = false;
	public static int highlightPosition = 0;
	public static int moveStatus = STOP;
	
	public static Paint paintHilightLine = null;
	
	public static void initData() {
		drawStockSize = 30;
		quoteListSize = 0;
		startIndex = 0;	
			
		chartWidth = 0;
		
		chartWidthGap = 0;
		
		showInfo = false;
		highlightPosition = 0;
		moveStatus = STOP;
		
		paintHilightLine = new Paint();
		paintHilightLine.setStyle(Paint.Style.STROKE);
		paintHilightLine.setColor(Color.rgb(255, 187, 0));
		paintHilightLine.setStrokeWidth(5);
	}
	
	public static void drawHighlightLine(Canvas canvas, float chartHeight) {		
		float positionX = chartWidthGap/2 + chartWidthGap * highlightPosition;
		canvas.drawLine(positionX, 0,positionX, chartHeight, paintHilightLine);
	}
	
}
